refactor, add text based error messages