Refactoring n stuff