tighten-up error handeling best practices