Major refactor!