work to optimize some of the current functions