Some extended refactoring