refactoring odds and ends