change function signatures, make scope optional