did some modularizing