removed dependence on type assertions/interface{}. thanks @shurcooL!