In this case, "take time to improve ..." is better than "spend time improving ...".
If you're saying how you spent the time (or money), use the -ing form.
If you're saying why you spent the time (or money), use the to - form.
If you're saying how you spent the time (or money), use the -ing form.
If you're saying why you spent the time (or money), use the to - form.