cleaned up internal util