Make tests use functions, I'm interrested in how rust generates code, also make functions more generic - do not rely on hard-coded constants as this would give unfair hints to the compiler