Cleaned up pin controller