Made some slight code refactors