Updated extension code and structure