reorganization of code