Added profiling to all methods and added support for capturing arguments.