Created some functions for cleaner code