Fixed dodgy refactor