gsp refactoring