Use before_save, other improvements