Added profiling hooks