This is duplicated code. Only the option block needs to be in the if/else.