Refactor; Add support for conditions