Refactored a lille bit