Few small style changes and tidying up code some more