further refactor