code simplication