added configurable support for profiling