Refactoring extends, adding test