refactor leftovers causing runtime crash fixed