Some refactoring:)