refactoring alittle