clean up and moving things around a little to better server the needed functions