modularized the class