changed API, made immutable