write some classes to shorten and organize code