Refactor init() method