Refactor options handling for clarity