Refactoring for better options handling