Cleaned up exception handling
Dynamic creation of the four methods that are identical