Refactored code for pinscontroller.rb