code refactory

lift some code into the base transformation class