further refactored