Restructure with classes