Just refactored the code a little.