refacto modulebase as an abstract class