Better way of profiling