Use Module instead of inheritance. Clean up code and test