Some refactoring. Then fell asleep.