Small refactoring and cleaning