Modularize modal closing call