Cleanup a bit of code to look a bit more tidy