Made base class abstract, and cleaned up code