rearrange java scripts