refactoring after nites