Small refactoring, removed unused code