Fix get commits by obvious set name of branch. Code refactoring accorfing to @tadatuta notations for this pull request