cleanup, implement discovery