Refactored weather code into a class using a singleton design pattern.