small code rafactoring