modularize code