refactored onkeyup