Migrating database methods to task object