OASISify and rearrange source code