refactor table view