Refactored hooker code and usage - added methods for opts preparing
Extracted context preparing into separate method