modularize design patterns