Refactor (add checks)