Added additional user options and refactored code