Small refactoring here and there