Refactor table