Refactored code for better hook customization.
Updated readme