code structure improved set up cardapplyclosed page