Refactor modules and inheritance

DRY modules with `Base` class.