Created abstract class and interface.

Also formatted all code.