small code structure refactor