Major refactor to singleton class