refactored locker.rb