Added some refactorring