Methods below looks awfully close to each other. Can we do some metaprogramming magic here?