Refactor task table