Refactored A LOT