Rearranged code to make sell book page load faster