Simplify main function with magic monads