rename to modules, support trailing slash