Refactor

rewriting...