added some functions for cleaner code