minor refcatoring