moved code for expanding to refresh method