[pgb][hook] general refactoring / cleanup