little code refactor