Engineering the smart factory