various refactorings to reduce technical debt