refactor to have single init