STABLE: directory refactoring fully tested