Refactor, trying to get modals working, being a little bitch.