code cleanup, remove helper, add logs