functional g boilerplate