simplified the api injection, changed clear to a immutable duplicate method