[Gatekeeper] Modified the code to make it more generic, and included required dependencies