optimazation and preparing for execute task