Refactored a little bit..