refactoring some gene stuff; not happy with it