maintenance refactorings to bring code up to snuff