Removed global variable and added hook for format class registration