reorder code layout