better formatting and regex