add tests for gene,  small refactoring