Optimisation of a Manufacturing Execution System (MES)