Modifications for multiple instance (added user_handle) and cleanup inde...

...ntation for clarity.