Made some refactors