move a duplicated function to utils
move metainfo hash field one more time
horrible commit: huge refactoring, lots of warnings fixed, some TODO items implemented.