MWTP: minor optimisations and cleanup