Refactored everyhting to the better