refactored behavior