Switch to using reflection and make it less shit