Add support for using color prior in do_task_eval and masive code clean up