modularized code for reusability