Re-factored to implement basic functions with only reflection