Here are some tips to improve handwriting:
-Grab your pen in a right way.
-Get a proper model that you can mimic.
-Use notebook with ruled lines.
-Follow the designated stroke order.
-Make vertical line vertical, horizontal line horizontal.
-Pay attention to the balance of each parts.
-Take time to write one character. No rush.
-Both hiragana and katakana are made from Kanji. So it may help you if you know the original Kanji of them.
Actually, there are many native Japanese speakers who write terrible handwriting. So it's very impressive that you, as a foreigner, want to write a nice handwriting in Japanese :)