made it less hacky