Refactored for more separation.