Changing to use MaybeT
Making function signature more generic