refactor public