improve refresh behavior, remove raw_input