handle side effects better + dont wrap code in object