Refactored a bit...