controller pin read/write refactor