moved some position related function around to better fit the single responsiblity principle