Refactored options code to separate class