Did some refactoring :)