build 986 (WIP): common core:
-bug fix + refactoring.