Modify refresh time. Cleanup of code.