update function signatures to take environment into account