reoder methods; improve getExtension method