refactor extensions api for cleaner extension signatures