Cleaned up functions to update parameters.