Refactor Oops error 1