Updated design and moved extension code.