Removing redundant entities. Work dir programmatic restriction added