refactor initial workflow