refactor

just personal preference for casting
fix some styling in tests