refactor initial setup method