Refactor custom options passing