added preference class and command line arguments support