refactoring, removed old function