Code tydied a bit