Refactor to make spring injection work.