Tried to clean up the calls and make functions