Refactor constructors of Task