generify modal and add close and show methods.