removed original methods and replaced with just one function for metaprogramming magic