Refactored A LOT of stuff