refactor and separate design concerns