there is a lot happening in this method, we should wrap it with profileIn/Out calls