Refactor into a Singleton class