moved ui code out of codebehind