some weekend refactorings