err, now refactored