Refactoring of Powertypes pattern + Some cleaning