And a little bit more refactoring