refactor GPs framework