Code clean up (thx to @jozic)