Refactoring: bug fix, singleton initial commit