modularized nicely