re-factoring code, create init method and core parameters