cleaned up redundancy in Transformer class