removed abstract methods and added factories.

Some formating has changed too :(