more code reorganization
code cleaning