removing more unused code and moving more to util