added options class

reduced main function complexity