Add singleton pattern to main class