Refactor category form