this method is going to be so much more readable with 2-3 early returns :)