Modularized code in Insert