added params class to init.
restructured code.