Move metaprogramming into safe_console method