Cleaned up code on Pins Controller code