Moved some logic out of watch statements into own functions