Fix terrible performance