Refactorconfig representation to record type.
Replace applicative with monadic style for consistency.
Remove extra white space in pattern-matches and do bindings.