Simplified some tedious profiling code

Change-Id: Ia5d56b3a38feb1b151f6821d76abbdd6b2dd9f46
Merge "Simplified some tedious profiling code"