refactored input focusing to separate function
cleanup + fixes