improved preprocessing, modules reorganization