+abit of refactoring