Resolves performance issue reported in #6