moved init logic and parameters to constructor