Move automatic discovery into framework