Cleaned up some functions and implemented group functions throughout the framework.