small refactoring, code gets more structured and straight