moved misc helper functions to separate file and removed redundant includes