Some cleanup and changes

Hi! I'm adapting this project a bit for something I've been working on, thought I might as well contribute back! :+1: