Added pull-to-refresh control and some small changes in logic.