files reorganization, code fix