Refactor some controls