relocated some functions for increased usability