Closure based modularization