Added some changes from refactoring :)