Rebar3 support and code sharing

It seems the only difference between this and the other similar code blocks below is what you put for example and short_desc, can we refactor this to a function that takes those two things are arguments and returns the object?