refactored from logic for input bluring/focusing