refactored again to not hardcode factors