1st refactor