Refactored certain stuffs