Did some optimisations