it seems like more idiomatic and generalized approach