slight refactoring - still need to fix wire shit