Refactor wet code