More code styling and return value optimisations