reorganizing
nice modularized code