Bit more refactoring