Refactor to be a little faster