Move the parameters into a singleton class config and fix some bugs