modularized the fun