PassThroughCode refactoring and create PassThrough Core and API for enhace reusability

Do we need a null check for handler?