more refactoring, removing code replaced by duplex