more refactoring
removed one-to-one bug