refactor code-structure