refactoring into a module & initialize function receiving params