Cleanup

gather useful commit:
and
count distinct
distinct
helpter methods
bugfix