move logs inside functions
breaking more things apart