using better names, more refactoring