Changed and refactored some stuff