Added some of the refacorings i forgot