Refactored code based in PSR-2 standard.