restructuring a little into helper module