gwpsd : start refactoring