last minute refactoring