Cleaned up and changes focus behavior to make using the textbox easier.