modularizing this motherfucker