Refactor to support more options