added modularize method