Just a bit more code refactoring