added some generic options, reformated some code