refund front system with a better organization & code optimizations