small reffactoring