further refactorings to improve code-quality