refactor GP framework