cleaned up extensions code