refactored a couple of functions to make them clearer
refactored a couple of functions to make them clearer

chtisgit/mine152,fador/mineserver,chtisgit/mine152,fador/mineserver,fador/mineserver,chtisgit/mine152,chtisgit/mine152,fador/mineserver