Cleaned up pins controller