Refactored to Activation functions and Exceptions