modularizing different class methods