Refactored and changed some stuff