Add feature to pass arguments to generator function and constructor