bit of jsbeautify where possible