Modularizing some parts