moved module exports to functions