Did some cleaning as well as removed functions that weren't in use