reaftored to better consistency