Refactored to make each behavior more independent