modulize different part of code