refactorings to make code more compliant