This was inspired by the deprecation stuff, i've taken a stab at refactoring both.