Refactor code, add SingleTon