refactored, method extracted