minor refactored