Refactored optionals functions