Refactored a few things to make them more explicit.