Fixed: do not calculate hash from optional parameters
Fixed possible missing query param
small refactoring