refactoring if statements and Refresh Item List