improvements to helpers, added logging