improved code structure
improved code structure