Fixed so using more of the world functions and removed code duplication