Variables parsing and tasks cleanup