Refactor extensions library